]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Replace deprecated lower/raise calls
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Nov 2019 19:17:19 +0000 (20:17 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Nov 2019 08:42:57 +0000 (09:42 +0100)
Those methods have been deprecated for a long time, so
move to the drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808

16 files changed:
js/ui/background.js
js/ui/boxpointer.js
js/ui/dnd.js
js/ui/ibusCandidatePopup.js
js/ui/layout.js
js/ui/lightbox.js
js/ui/magnifier.js
js/ui/modalDialog.js
js/ui/overview.js
js/ui/popupMenu.js
js/ui/screenShield.js
js/ui/windowManager.js
js/ui/workspace.js
js/ui/workspaceThumbnail.js
js/ui/xdndHandler.js
tests/interactive/scroll-view-sizing.js

index 44476418fc36e36d12c302cb275562706890f107..f99ad381c1ce216c661bff4681a7a27cb2c13550 100644 (file)
@@ -767,7 +767,7 @@ var BackgroundManager = class BackgroundManager {
         if (this._controlPosition) {
             let monitor = this._layoutManager.monitors[this._monitorIndex];
             backgroundActor.set_position(monitor.x, monitor.y);
-            backgroundActor.lower_bottom();
+            this._container.set_child_below_sibling(backgroundActor, null);
         }
 
         let changeSignalId = background.connect('bg-changed', () => {
index d55543a705eb21c9fa2343aa321ae028bcf33679..319702403512dc9b4f34842c60d5b73b37d47e3e 100644 (file)
@@ -44,7 +44,7 @@ var BoxPointer = GObject.registerClass({
         this._border = new St.DrawingArea();
         this._border.connect('repaint', this._drawBorder.bind(this));
         this.add_actor(this._border);
-        this.bin.raise(this._border);
+        this.set_child_above_sibling(this.bin, this._border);
         this._sourceAlignment = 0.5;
         this._muteInput = true;
 
index 7d3929d6e444acb86a466c2fda7ca3e881a0a1d6..6fff86b251dade3a5d1e6b6ee7954a6280a0056d 100644 (file)
@@ -338,7 +338,7 @@ var _Draggable = class _Draggable {
         if (this.actor._delegate && this.actor._delegate.getDragActor) {
             this._dragActor = this.actor._delegate.getDragActor();
             Main.uiGroup.add_child(this._dragActor);
-            this._dragActor.raise_top();
+            Main.uiGroup.set_child_above_sibling(this._dragActor, null);
             Shell.util_set_hidden_from_pick(this._dragActor, true);
 
             // Drag actor does not always have to be the same as actor. For example drag actor
@@ -388,7 +388,7 @@ var _Draggable = class _Draggable {
 
             this._dragOrigParent.remove_actor(this._dragActor);
             Main.uiGroup.add_child(this._dragActor);
-            this._dragActor.raise_top();
+            Main.uiGroup.set_child_above_sibling(this._dragActor, null);
             Shell.util_set_hidden_from_pick(this._dragActor, true);
         }
 
index aadd43087607bf1e9a7a42e0849e471d25f12bd0..cdd547d2a7433a53b5c94884332ae9b5b380e614 100644 (file)
@@ -308,7 +308,7 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
         if (isVisible) {
             this.setPosition(this._dummyCursor, 0);
             this.open(BoxPointer.PopupAnimation.NONE);
-            this.raise_top();
+            this.get_parent().set_child_above_sibling(this, null);
         } else {
             this.close(BoxPointer.PopupAnimation.NONE);
         }
index ed552b36750ab41bcbfc92258e84790a0ef0e258..6729f87c406d3df7b23331179f4d284bab633159 100644 (file)
@@ -269,7 +269,7 @@ var LayoutManager = GObject.registerClass({
 
         this._backgroundGroup = new Meta.BackgroundGroup();
         global.window_group.add_child(this._backgroundGroup);
-        this._backgroundGroup.lower_bottom();
+        global.window_group.set_child_below_sibling(this._backgroundGroup, null);
         this._bgManagers = [];
 
         this._interfaceSettings = new Gio.Settings({
index 35e40016f7c8ccbd9df8cfe4cf113511d7b96338..47659de7c011710929089c53b77c14b7bb0435da 100644 (file)
@@ -139,7 +139,7 @@ var Lightbox = GObject.registerClass({
             this.set({ opacity: 0, style_class: 'lightbox' });
 
         container.add_actor(this);
-        this.raise_top();
+        container.set_child_above_sibling(this, null);
 
         this.connect('destroy', this._onDestroy.bind(this));
 
@@ -264,9 +264,9 @@ var Lightbox = GObject.registerClass({
         let below = this;
         for (let i = this._children.length - 1; i >= 0; i--) {
             if (this._children[i] == window)
-                this._children[i].raise_top();
+                this._container.set_child_above_sibling(this._children[i], null);
             else if (this._children[i] == this._highlighted)
-                this._children[i].lower(below);
+                this._container.set_child_below_sibling(this._children[i], below);
             else
                 below = this._children[i];
         }
index 191784c209144d3d7826719db3d4529026254cd7..6893e1fe9d4b914f9b4384a8110d9bb7ac6fe6f2 100644 (file)
@@ -1651,7 +1651,7 @@ class Crosshairs extends Clutter.Actor {
                 }
 
                 container.add_actor(crosshairsActor);
-                container.raise_child(magnifiedMouse, crosshairsActor);
+                container.set_child_above_sibling(magnifiedMouse, crosshairsActor);
                 let [xMouse, yMouse] = magnifiedMouse.get_position();
                 let [crosshairsWidth, crosshairsHeight] = crosshairsActor.get_size();
                 crosshairsActor.set_position(xMouse - crosshairsWidth / 2, yMouse - crosshairsHeight / 2);
index f35774407584a227212d84d2a1ae653d425a2574..d7633acd865871043db47ec23111b246920ad9fa 100644 (file)
@@ -206,7 +206,7 @@ var ModalDialog = GObject.registerClass({
         this._hasModal = false;
 
         if (!this._shellReactive)
-            this._eventBlocker.raise_top();
+            this.backgroundStack.set_child_above_sibling(this._eventBlocker, null);
     }
 
     pushModal(timestamp) {
@@ -229,7 +229,7 @@ var ModalDialog = GObject.registerClass({
         }
 
         if (!this._shellReactive)
-            this._eventBlocker.lower_bottom();
+            this.backgroundStack.set_child_below_sibling(this._eventBlocker, null);
         return true;
     }
 
index e09f523be53a9cb798328ce19e93c26e9bfdd049..bb4ab092c3d68cfe8ddc6dffa1aac871a1eb93eb 100644 (file)
@@ -581,7 +581,8 @@ var Overview = class {
         });
         this._shadeBackgrounds();
 
-        this._coverPane.raise_top();
+        Main.layoutManager.overviewGroup.set_child_above_sibling(
+            this._coverPane, null);
         this._coverPane.show();
         this.emit('showing');
     }
@@ -644,7 +645,8 @@ var Overview = class {
         });
         this._unshadeBackgrounds();
 
-        this._coverPane.raise_top();
+        Main.layoutManager.overviewGroup.set_child_above_sibling(
+            this._coverPane, null);
         this._coverPane.show();
         this.emit('hiding');
     }
index 74c228f56e06322c246f952240f7ca0b507528b3..c168e00dc143bc53b1c556bf6cafc208bcbc4e8c 100644 (file)
@@ -892,7 +892,7 @@ var PopupMenu = class extends PopupMenuBase {
         this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment);
         this._boxPointer.open(animate);
 
-        this.actor.raise_top();
+        this.actor.get_parent().set_child_above_sibling(this.actor, null);
 
         this.emit('open-state-changed', true);
     }
index 71f8795ac772172e76822388defadba60a7a1406..b640962444b9db265d6719345308891b6906de3a 100644 (file)
@@ -464,7 +464,7 @@ var ScreenShield = class {
         this._backgroundGroup = new Clutter.Actor();
 
         this._lockScreenGroup.add_actor(this._backgroundGroup);
-        this._backgroundGroup.lower_bottom();
+        this._lockScreenGroup.set_child_below_sibling(this._backgroundGroup, null);
         this._bgManagers = [];
 
         this._updateBackgrounds();
index c184db18146ca4d63b8412de81e8636ba77cc368..5b33877418d900fcc550a68f9b14f17664a512c2 100644 (file)
@@ -1874,13 +1874,13 @@ var WindowManager = class {
                          actor: new Clutter.Actor() };
             switchData.surroundings[dir] = info;
             switchData.container.add_actor(info.actor);
-            info.actor.raise_top();
+            switchData.container.set_child_above_sibling(info.actor, null);
 
             let [x, y] = this._getPositionForDirection(dir, curWs, ws);
             info.actor.set_position(x, y);
         }
 
-        switchData.movingWindowBin.raise_top();
+        wgroup.set_child_above_sibling(switchData.movingWindowBin, null);
 
         for (let i = 0; i < windows.length; i++) {
             let actor = windows[i];
index 48329e18e1a4c5ff0da95840f41975774aeaa1d7..15d9be503f2e520dbf40a1599a6aee926cb7ab3e 100644 (file)
@@ -328,11 +328,12 @@ var WindowClone = GObject.registerClass({
             // We'll fix up the stack after the drag
             return;
 
+        let parent = this.get_parent();
         let actualAbove = this.getActualStackAbove();
         if (actualAbove == null)
-            this.lower_bottom();
+            parent.set_child_below_sibling(this, null);
         else
-            this.raise(actualAbove);
+            parent.set_child_above_sibling(this, actualAbove);
     }
 
     _disconnectSignals() {
@@ -462,11 +463,12 @@ var WindowClone = GObject.registerClass({
         // We may not have a parent if DnD completed successfully, in
         // which case our clone will shortly be destroyed and replaced
         // with a new one on the target workspace.
-        if (this.get_parent() != null) {
+        let parent = this.get_parent();
+        if (parent !== null) {
             if (this._stackAbove == null)
-                this.lower_bottom();
+                parent.set_child_below_sibling(this, null);
             else
-                this.raise(this._stackAbove);
+                parent.set_child_above_sibling(this, this._stackAbove);
         }
 
 
@@ -671,7 +673,8 @@ var WindowOverlay = class {
     }
 
     _animateVisible() {
-        this._parentActor.raise_top();
+        this._parentActor.get_parent().set_child_above_sibling(
+            this._parentActor, null);
 
         let toAnimate = [this.border, this.title];
         if (this._windowCanClose())
index d7cd6396cfe7fabbe37c50e29e34b0a67159bc40..7604d503c7dd8917558b26ec3b90778a9c6b7201 100644 (file)
@@ -124,11 +124,12 @@ var WindowClone = GObject.registerClass({
         if (actor.inDrag)
             return;
 
+        let parent = this.get_parent();
         let actualAbove = this.getActualStackAbove();
         if (actualAbove == null)
-            this.lower_bottom();
+            parent.set_child_below_sibling(this, null);
         else
-            this.raise(actualAbove);
+            parent.set_child_above_sibling(this, actualAbove);
     }
 
     addAttachedDialog(win) {
@@ -214,11 +215,12 @@ var WindowClone = GObject.registerClass({
         // We may not have a parent if DnD completed successfully, in
         // which case our clone will shortly be destroyed and replaced
         // with a new one on the target workspace.
-        if (this.get_parent() != null) {
+        let parent = this.get_parent();
+        if (parent !== null) {
             if (this._stackAbove == null)
-                this.lower_bottom();
+                parent.set_child_below_sibling(this, null);
             else
-                this.raise(this._stackAbove);
+                parent.set_child_above_sibling(this, this._stackAbove);
         }
 
 
@@ -1014,7 +1016,7 @@ var ThumbnailsBox = GObject.registerClass({
         this._queueUpdateStates();
 
         // The thumbnails indicator actually needs to be on top of the thumbnails
-        this._indicator.raise_top();
+        this.set_child_above_sibling(this._indicator, null);
 
         // Clear the splice index, we got the message
         this._spliceIndex = -1;
index d56385428fa71440b8a5351edc6c1459ac8001e2..df5314d4edb03d6c35c41bf7cfc5540e650d379d 100644 (file)
@@ -80,7 +80,7 @@ var XdndHandler = class {
 
         // Make sure that the cursor window is on top
         if (this._cursorWindowClone)
-            this._cursorWindowClone.raise_top();
+            Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
 
         let dragEvent = {
             x: x,
index b5eb17949cec84344c5f2d75c87ebf008a80db72..dc1613d0cb0f2d991765af9985ad75bc6e4f40e7 100644 (file)
@@ -154,7 +154,7 @@ class SizingIllustrator extends St.Widget {
     add(child) {
         this.child = child;
         this.add_child(child);
-        this.child.lower_bottom();
+        this.set_child_below_sibling(child, null);
     }
 
     vfunc_get_preferred_width(forHeight) {